Skip to content

ConnectionOptions interface is incompatible with @types/pg definitions#2637

Open
jameshfisher wants to merge 1 commit intobrianc:masterfrom
jameshfisher:patch-1
Open

ConnectionOptions interface is incompatible with @types/pg definitions#2637
jameshfisher wants to merge 1 commit intobrianc:masterfrom
jameshfisher:patch-1

Conversation

@jameshfisher
Copy link
Copy Markdown

Using pg-connection-string with @types/pg currently results in a type error like this:

Argument of type 'ConnectionOptions' is not assignable to parameter of type 'PoolConfig'.
  Types of property 'database' are incompatible.
    Type 'string | null | undefined' is not assignable to type 'string | undefined'.
      Type 'null' is not assignable to type 'string | undefined'.ts(2345)

See clashing definition: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/08f0feedca9329fe95d23ccc64886e3db03195bf/types/pg/index.d.ts#L18

Using pg-connection-string with @types/pg currently results in a type error like this:

    Argument of type 'ConnectionOptions' is not assignable to parameter of type 'PoolConfig'.
      Types of property 'database' are incompatible.
        Type 'string | null | undefined' is not assignable to type 'string | undefined'.
          Type 'null' is not assignable to type 'string | undefined'.ts(2345)

See clashing definition: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/08f0feedca9329fe95d23ccc64886e3db03195bf/types/pg/index.d.ts#L18
@hjr3 hjr3 self-requested a review April 11, 2025 10:22
@hjr3 hjr3 self-assigned this Apr 11, 2025
@hjr3
Copy link
Copy Markdown
Collaborator

hjr3 commented Apr 11, 2025

There are more problems with having ConnectionOptions match ClientConfig. See #2280

We landed #3128 to remedy this issue. Please let me know if you are still having problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants